//
//  WCExtractText.m
//  WebClipper
//
//  Created by Daniel Braun on 15/03/07.
//  Copyright 2007 Daniel Braun http://page-appart.net, http://braun.daniel.free.fr All rights reserved.
//

#import "WCExtractText.h"


@implementation WCExtractText

+ (NSString *) description
{
	return @"convert to text";
}


- (id) initWithCoder:(NSCoder *) coder
{
	self=[super initWithCoder:coder];
	if ([coder allowsKeyedCoding]) {
	}
	return self;
}

- (void)encodeWithCoder:(NSCoder *)coder
{
	[super encodeWithCoder:coder];
	if ( [coder allowsKeyedCoding] ) {
	}
}
- (id) handle:(DOMHTMLElement *)el fromUrl:(NSURL *)url
{
	id value=nil;
	if ([el respondsToSelector:@selector(innerText)]) value=[(id)el innerText];
	else if ([el respondsToSelector:@selector(nodeValue)]) {
		value=[(id)el nodeValue];
	} else if ([el respondsToSelector:@selector(stringValue)]) {
		value=[(id)el stringValue];	
	}
	return value;
}

@end
